//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.neurosky.thinkgear;

import android.util.Log;

public class TF_TD_Libraries {
    public TF_TD_Libraries() {
    }

    public class BandPower
    {

        private double[][] a;
        private double[][] b;
        private double[][] c;
        private double[][] d = { { 1.0D, 4.0D }, { 4.0D, 8.0D }, { 8.0D, 11.0D }, { 11.0D, 14.0D }, { 14.0D, 25.0D }, { 25.0D, 36.0D }, { 36.0D, 40.0D }, { 40.0D, 44.0D } };

        public BandPower(TF_TD_Libraries paramTF_TD_Libraries) {}

        public TF_TD_Libraries.Bandpower_Return Bandpower_fun(double[] paramArrayOfDouble, int paramInt1, int paramInt2, int paramInt3)
        {
            int i = this.d.length;
            this.c = new double[i][paramArrayOfDouble.length];
            this.a = new double[i][(int)(Math.floor((paramArrayOfDouble.length - paramInt2 * paramInt1) / (paramInt3 * paramInt1)) + 1.0D)];
            double[] arrayOfDouble4;
            int i3;
            double[] arrayOfDouble6;
            for (int j = 0; j < i; j++)
            {
                double d1 = this.d[j][0] / paramInt1 * 2.0D;
                double d2 = this.d[j][1] / paramInt1 * 2.0D;
                double[] arrayOfDouble5 = { d1, d2 };
                TF_TD_Libraries.Butter localButter;
                TF_TD_Libraries.Butter_Return localButter_Return;
                double[] arrayOfDouble7 = (localButter_Return = (localButter = new TF_TD_Libraries.Butter(this.e)).ButterworthBandPassFilter(4, arrayOfDouble5)).get_B();
                double[] arrayOfDouble1 = localButter_Return.get_A();
                TF_TD_Libraries.filtfilt localfiltfilt;
                arrayOfDouble1 = (localfiltfilt = new TF_TD_Libraries.filtfilt(this.e)).ZeroPhaseFiltering(arrayOfDouble7, arrayOfDouble1, paramArrayOfDouble);
                for (int m = 0; m < arrayOfDouble1.length; m++) {
                    this.c[j][m] = arrayOfDouble1[m];
                }
                double[] arrayOfDouble2 = new double[arrayOfDouble1.length];
                for (int i2 = 0; i2 < arrayOfDouble1.length; i2++) {
                    arrayOfDouble2[i2] = Math.pow(this.c[j][i2], 2.0D);
                }
                arrayOfDouble4 = new double[arrayOfDouble2.length];
                for (int i7 = 0; i7 < arrayOfDouble2.length; i7++) {
                    if (Double.isNaN(arrayOfDouble2[i7])) {
                        arrayOfDouble4[i7] = 0.0D;
                    } else {
                        arrayOfDouble4[i7] = arrayOfDouble2[i7];
                    }
                }
                double d4;
                arrayOfDouble1 = new double[(int)(Math.floor(d4 = (arrayOfDouble4.length - paramInt2 * paramInt1) / (paramInt3 * paramInt1)) + 1.0D)];
                for (int n = 0; n < arrayOfDouble1.length; n++)
                {
                    i3 = 1 + paramInt3 * paramInt1 * n;
                    int i4;
                    arrayOfDouble6 = new double[(i4 = paramInt2 * paramInt1 + paramInt3 * paramInt1 * n) - i3 + 1];
                    for (int i8 = 0; i8 < arrayOfDouble6.length; i8++) {
                        arrayOfDouble6[i8] = arrayOfDouble4[(i8 + i3 - 1)];
                    }
                    double d5 = 0.0D;
                    for (i3 = 0; i3 < arrayOfDouble6.length; i3++) {
                        d5 += arrayOfDouble6[i3];
                    }
                    arrayOfDouble1[n] = (d5 / arrayOfDouble6.length);
                }
                double[] arrayOfDouble3 = new double[this.c[0].length];
                for (i3 = 0; i3 < arrayOfDouble3.length; i3++) {
                    if (Double.isNaN(this.c[j][i3])) {
                        arrayOfDouble3[i3] = 0.0D;
                    } else {
                        arrayOfDouble3[i3] = this.c[j][i3];
                    }
                }
                for (i3 = 0; i3 < arrayOfDouble1.length; i3++) {
                    this.a[j][i3] = arrayOfDouble1[i3];
                }
            }
            j = this.a.length;
            int k = this.a[0].length;
            this.b = new double[j][k];
            for (int i1 = 0; i1 < j; i1++)
            {
                arrayOfDouble4 = new double[k];
                for (i3 = 0; i3 < k; i3++)
                {
                    arrayOfDouble6 = new double[j];
                    for (int i5 = 0; i5 < j; i5++) {
                        arrayOfDouble6[i5] = this.a[i5][i3];
                    }
                    double d3 = 0.0D;
                    for (int i6 = 0; i6 < arrayOfDouble6.length; i6++) {
                        d3 += arrayOfDouble6[i6];
                    }
                    arrayOfDouble4[i3] = (this.a[i1][i3] / d3 * 100.0D);
                }
                for (i3 = 0; i3 < arrayOfDouble4.length; i3++) {
                    this.b[i1][i3] = arrayOfDouble4[i3];
                }
            }
            return new TF_TD_Libraries.Bandpower_Return(this.e, this.a, this.b, this.c);
        }

    }

    public class Bandpower_Return
    {
        protected double[][] _bp;
        protected double[][] _rbp;
        protected double[][] _bs;

        public Bandpower_Return(TF_TD_Libraries paramTF_TD_Libraries,
                                double[][] paramArrayOfDouble1,
                                double[][] paramArrayOfDouble2,
                                double[][] paramArrayOfDouble3)
        {
            this._bp = paramArrayOfDouble1;
            this._rbp = paramArrayOfDouble2;
            this._bs = paramArrayOfDouble3;
        }

        public double[][] get_bp()
        {
            return this._bp;
        }

        public double[][] get_rbp()
        {
            return this._rbp;
        }

        public double[][] get_bs()
        {
            return this._bs;
        }
    }

    public class Butter
    {
        private TF_TD_Libraries.Complex a = new TF_TD_Libraries.Complex(0.0D, -1.0D);

        public Butter(TF_TD_Libraries paramTF_TD_Libraries) {}

        public TF_TD_Libraries.Butter_Return ButterworthBandPassFilter(
                int paramInt, double[] paramArrayOfDouble)
        {
            double d1 = paramArrayOfDouble[0];
            double d2 = paramArrayOfDouble[1];
            double d5 = d2;
            double d3 = d1;
            double[] arrayOfDouble2 = paramInt;
            Object localObject1 = this;
            double[] arrayOfDouble10 = new double[2 * arrayOfDouble2];
            double[] arrayOfDouble11 = new double[2 * arrayOfDouble2];
            double d7 = Math.cos(3.141592653589793D * (d5 + d3) / 2.0D);
            double d6;
            double d8 = Math.sin(d6 = 3.141592653589793D * (d5 - d3) / 2.0D);
            double d9 = Math.cos(d6);
            double d10 = d8 * 2.0D * d9;
            double d11 = d9 * 2.0D * d9 - 1.0D;
            for (int j = 0; j < arrayOfDouble2; j++)
            {
                double d14;
                d15 = Math.sin(d14 = 3.141592653589793D * (2 * j + 1) / (2 * arrayOfDouble2));
                double d16 = Math.cos(d14);
                double d18 = 1.0D + d10 * d15;
                arrayOfDouble10[(2 * j)] = (d11 / d18);
                arrayOfDouble10[(2 * j + 1)] = (d10 * d16 / d18);
                arrayOfDouble11[(2 * j)] = (d7 * -2.0D * (d9 + d8 * d15) / d18);
                arrayOfDouble11[(2 * j + 1)] = (d7 * -2.0D * d8 * d16 / d18);
            }
            double[] arrayOfDouble3 = arrayOfDouble10;
            localObject1 = arrayOfDouble11;
            paramArrayOfDouble = arrayOfDouble2;
            double[] arrayOfDouble4;
            (arrayOfDouble4 = new double[4 * paramArrayOfDouble])[2] = arrayOfDouble3[0];
            arrayOfDouble4[3] = arrayOfDouble3[1];
            arrayOfDouble4[0] = localObject1[0];
            arrayOfDouble4[1] = localObject1[1];
            for (double[] arrayOfDouble5 = 1; arrayOfDouble5 < paramArrayOfDouble; arrayOfDouble5++)
            {
                arrayOfDouble4[(2 * (2 * arrayOfDouble5 + 1))] += arrayOfDouble3[(2 * arrayOfDouble5)] * arrayOfDouble4[(2 * (2 * arrayOfDouble5 - 1))] - arrayOfDouble3[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[(2 * (2 * arrayOfDouble5 - 1) + 1)];
                arrayOfDouble4[(2 * (2 * arrayOfDouble5 + 1) + 1)] += arrayOfDouble3[(2 * arrayOfDouble5)] * arrayOfDouble4[(2 * (2 * arrayOfDouble5 - 1) + 1)] + arrayOfDouble3[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[(2 * (2 * arrayOfDouble5 - 1))];
                for (int n = 2 * arrayOfDouble5; n > 1; n--)
                {
                    arrayOfDouble4[(2 * n)] += localObject1[(2 * arrayOfDouble5)] * arrayOfDouble4[(2 * (n - 1))] - localObject1[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[(2 * (n - 1) + 1)] + arrayOfDouble3[(2 * arrayOfDouble5)] * arrayOfDouble4[(2 * (n - 2))] - arrayOfDouble3[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[(2 * (n - 2) + 1)];
                    arrayOfDouble4[(2 * n + 1)] += localObject1[(2 * arrayOfDouble5)] * arrayOfDouble4[(2 * (n - 1) + 1)] + localObject1[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[(2 * (n - 1))] + arrayOfDouble3[(2 * arrayOfDouble5)] * arrayOfDouble4[(2 * (n - 2) + 1)] + arrayOfDouble3[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[(2 * (n - 2))];
                }
                arrayOfDouble4[2] += localObject1[(2 * arrayOfDouble5)] * arrayOfDouble4[0] - localObject1[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[1] + arrayOfDouble3[(2 * arrayOfDouble5)];
                arrayOfDouble4[3] += localObject1[(2 * arrayOfDouble5)] * arrayOfDouble4[1] + localObject1[(2 * arrayOfDouble5 + 1)] * arrayOfDouble4[0] + arrayOfDouble3[(2 * arrayOfDouble5 + 1)];
                arrayOfDouble4[0] += localObject1[(2 * arrayOfDouble5)];
                arrayOfDouble4[1] += localObject1[(2 * arrayOfDouble5 + 1)];
            }
            localObject1 = arrayOfDouble4;
            (arrayOfDouble3 = new double[2 * arrayOfDouble2 + 1])[1] = localObject1[0];
            arrayOfDouble3[0] = 1.0D;
            arrayOfDouble3[2] = localObject1[2];
            for (int m = 3; m <= 2 * arrayOfDouble2; m++) {
                arrayOfDouble3[m] = localObject1[(2 * m - 2)];
            }
            paramArrayOfDouble = arrayOfDouble3;
            double[] arrayOfDouble6 = paramArrayOfDouble;
            d5 = d2;
            double d4 = d1;
            arrayOfDouble2 = paramInt;
            localObject1 = this;
            double[] arrayOfDouble7 = new double[2 * arrayOfDouble2 + 1];
            for (int i1 = 0; i1 < arrayOfDouble7.length; i1++) {
                arrayOfDouble7[i1] = i1;
            }
            double[] arrayOfDouble8 = new double[2 * arrayOfDouble2 + 1];
            TF_TD_Libraries.CVector localCVector = new TF_TD_Libraries.CVector(((Butter)localObject1).b, 2 * arrayOfDouble2 + 1);
            double d15 = arrayOfDouble2;
            Object localObject3 = localObject1;
            int i5;
            double[] arrayOfDouble13;
            (arrayOfDouble13 = new double[(i5 = d15) + 1])[0] = 1.0D;
            arrayOfDouble13[1] = i5;
            int k = i5 / 2;
            for (m = 2; m <= k; m++)
            {
                arrayOfDouble13[m] = ((i5 - m + 1) * arrayOfDouble13[(m - 1)] / m);
                arrayOfDouble13[(i5 - m)] = arrayOfDouble13[m];
            }
            arrayOfDouble13[(i5 - 1)] = i5;
            arrayOfDouble13[i5] = 1.0D;
            double[] arrayOfDouble12;
            for (double d17 = 0; d17 <= d15; d17++) {
                if (d17 % 2 != 0) {
                    arrayOfDouble12[d17] = (-arrayOfDouble12[d17]);
                }
            }
            Object localObject2;
            for (int i2 = 0; i2 < arrayOfDouble2; i2++)
            {
                arrayOfDouble8[(2 * i2)] = localObject2[i2];
                arrayOfDouble8[(2 * i2 + 1)] = 0.0D;
            }
            arrayOfDouble8[(2 * arrayOfDouble2)] = localObject2[arrayOfDouble2];
            double[] arrayOfDouble9;
            (arrayOfDouble9 = new double[2])[0] = (4.0D * Math.tan(d4 * 3.141592653589793D / 2.0D));
            arrayOfDouble9[1] = (4.0D * Math.tan(d5 * 3.141592653589793D / 2.0D));
            d10 = 2.0D * Math.atan2(Math.sqrt(arrayOfDouble9[0] * arrayOfDouble9[1]), 4.0D);
            for (int i3 = 0; i3 < arrayOfDouble7.length; i3++) {
                TF_TD_Libraries.CVector.a(localCVector)[i3] = TF_TD_Libraries.Complex.CExp(TF_TD_Libraries.Complex.CMultipleValue(TF_TD_Libraries.Complex.CMultipleValue(((Butter)localObject1).a, d10), arrayOfDouble7[i3]));
            }
            double d12 = 0.0D;
            double d13 = 0.0D;
            for (int i = 0; i < arrayOfDouble7.length; i++)
            {
                d12 += TF_TD_Libraries.Complex.CMultipleValue(TF_TD_Libraries.CVector.a(localCVector)[i], arrayOfDouble8[i]).getReal();
                d13 += TF_TD_Libraries.Complex.CMultipleValue(TF_TD_Libraries.CVector.a(localCVector)[i], arrayOfDouble6[i]).getReal();
            }
            double[] arrayOfDouble1 = new double[arrayOfDouble8.length];
            for (int i4 = 0; i4 < arrayOfDouble7.length; i4++) {
                arrayOfDouble1[i4] = (arrayOfDouble8[i4] * d13 / d12);
            }
            paramInt = (localObject2 = (arrayOfDouble12 = arrayOfDouble13) == null ? null : arrayOfDouble12) == null ? null : arrayOfDouble1;
            return new TF_TD_Libraries.Butter_Return(this.b, paramInt, paramArrayOfDouble);
        }
    }

    public class Butter_Return
    {
        protected double[] _B;
        protected double[] _A;

        public Butter_Return(TF_TD_Libraries paramTF_TD_Libraries, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
        {
            this._B = paramArrayOfDouble1;
            this._A = paramArrayOfDouble2;
        }

        public double[] get_B()
        {
            return this._B;
        }

        public double[] get_A()
        {
            return this._A;
        }
    }

    public class calmean
    {
        private int a;

        public calmean(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double mean(double[] paramArrayOfDouble)
        {
            TF_TD_Libraries.Diff localDiff = new TF_TD_Libraries.Diff(this.b);
            this.a = localDiff.return_row(paramArrayOfDouble, this.a);
            double d = 0.0D;
            for (int i = 0; i < this.a; i++) {
                d += paramArrayOfDouble[i];
            }
            return d /= this.a;
        }
    }

    public class Diff
    {
        private int a;

        public Diff(TF_TD_Libraries paramTF_TD_Libraries) {}

        public int return_row(double[] paramArrayOfDouble, int paramInt)
        {
            return paramInt = paramArrayOfDouble.length;
        }

        public double[] applydiff(double[] paramArrayOfDouble)
        {
            new Diff(this.b);
            this.a = return_row(paramArrayOfDouble, this.a);
            double[] arrayOfDouble = new double[this.a];
            for (int i = 0; i < this.a; i++) {
                if (i == 0) {
                    arrayOfDouble[i] = paramArrayOfDouble[i];
                } else {
                    paramArrayOfDouble[i] -= paramArrayOfDouble[(i - 1)];
                }
            }
            return arrayOfDouble;
        }
    }

    public class filtfilt
    {
        public filtfilt(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double[] ZeroPhaseFiltering(
                double[] paramArrayOfDouble1,
                double[] paramArrayOfDouble2, double[] paramArrayOfDouble3)
        {
            double d2 = paramArrayOfDouble2.length;
            double d1;
            int i = (int)((d1 = paramArrayOfDouble1.length) > d2 ? d1 : d2);
            int j = 3 * (i - 1);
            int k;
            if ((((k = paramArrayOfDouble3.length) <= j ? 1 : 0) | (i < 2 ? 1 : 0)) != 0) {
                Log.i("Warning", "Data must have length more than 3 times filter order.");
            }
            double[] arrayOfDouble1 = new double[i = 2 * j + k];
            int m = 0;
            for (int i1 = j + 1; i1 >= 2; i1--)
            {
                arrayOfDouble1[m] = (2.0D * paramArrayOfDouble3[0] - paramArrayOfDouble3[(i1 - 1)]);
                m++;
            }
            for (i1 = 0; i1 < k; i1++)
            {
                arrayOfDouble1[m] = paramArrayOfDouble3[i1];
                m++;
            }
            for (i1 = k - 1; i1 >= k - j; i1--)
            {
                arrayOfDouble1[m] = (2.0D * paramArrayOfDouble3[(k - 1)] - paramArrayOfDouble3[(i1 - 1)]);
                m++;
            }
            double[][] arrayOfDouble3 = new double[j / 3][j / 3];
            double[] arrayOfDouble2 = new double[j / 3];
            for (int i4 = 0; i4 < j / 3; i4++)
            {
                if (i4 == 0)
                {
                    arrayOfDouble3[0][0] = (1.0D + paramArrayOfDouble2[1]);
                }
                else
                {
                    arrayOfDouble3[i4][0] = paramArrayOfDouble2[(i4 + 1)];
                    arrayOfDouble3[i4][i4] = 1.0D;
                }
                if (i4 <= j / 3 - 2) {
                    arrayOfDouble3[i4][(i4 + 1)] = -1.0D;
                }
            }
            for (i4 = 0; i4 < j / 3; i4++) {
                arrayOfDouble2[i4] = (paramArrayOfDouble1[(i4 + 1)] - paramArrayOfDouble2[(i4 + 1)] * paramArrayOfDouble1[0]);
            }
            double[] arrayOfDouble11 = arrayOfDouble2;
            Object localObject = arrayOfDouble3;
            int i10 = j / 3;
            filtfilt localfiltfilt = this;
            arrayOfDouble2 = new double[i10];
            arrayOfDouble3 = new double[i10][i10 + 1];
            int i5;
            for (i4 = 0; i4 < i10; i4++) {
                for (i5 = 0; i5 < i10; i5++) {
                    arrayOfDouble3[i4][i5] = localObject[i4][i5];
                }
            }
            for (i4 = 0; i4 < i10; i4++) {
                arrayOfDouble3[i4][i10] = arrayOfDouble11[i4];
            }
            for (i4 = 0; i4 < i10; i4++)
            {
                double[][] arrayOfDouble10 = arrayOfDouble3;
                i7 = i4;
                i5 = i10;
                double d5 = Math.abs(arrayOfDouble10[i7][i7]);
                int i8 = i7;
                for (int i9 = i7 + 1; i9 < i5; i9++) {
                    if (d5 < Math.abs(arrayOfDouble10[i9][i7]))
                    {
                        d5 = Math.abs(arrayOfDouble10[i9][i7]);
                        i8 = i9;
                    }
                }
                if (i8 != i7) {
                    for (i9 = i7; i9 <= i5; i9++)
                    {
                        double d4 = arrayOfDouble10[i7][i9];
                        arrayOfDouble10[i7][i9] = arrayOfDouble10[i8][i9];
                        arrayOfDouble10[i8][i9] = d4;
                    }
                }
                double d3 = arrayOfDouble3[i4][i4];
                for (i5 = i4; i5 <= i10; i5++) {
                    arrayOfDouble3[i4][i5] /= d3;
                }
                for (i5 = i4 + 1; i5 < i10; i5++)
                {
                    d3 = arrayOfDouble3[i5][i4];
                    for (i7 = i4; i7 <= i10; i7++) {
                        arrayOfDouble3[i5][i7] -= d3 * arrayOfDouble3[i4][i7];
                    }
                }
            }
            arrayOfDouble2[(i10 - 1)] = arrayOfDouble3[(i10 - 1)][i10];
            for (i4 = i10 - 1; i4 >= 0; i4--)
            {
                arrayOfDouble2[i4] = arrayOfDouble3[i4][i10];
                for (i5 = i4 + 1; i5 < i10; i5++) {
                    arrayOfDouble2[i4] -= arrayOfDouble3[i4][i5] * arrayOfDouble2[i5];
                }
            }
            arrayOfDouble2 = new double[(arrayOfDouble6 = arrayOfDouble2).length];
            for (int i2 = 0; i2 < arrayOfDouble6.length; i2++) {
                arrayOfDouble6[i2] *= arrayOfDouble1[0];
            }
            double[] arrayOfDouble4 = new double[paramArrayOfDouble1.length];
            double[] arrayOfDouble7 = new double[paramArrayOfDouble2.length];
            for (int i7 = 0; i7 < arrayOfDouble4.length; i7++) {
                arrayOfDouble4[i7] = paramArrayOfDouble1[i7];
            }
            for (i7 = 0; i7 < arrayOfDouble7.length; i7++) {
                arrayOfDouble7[i7] = paramArrayOfDouble2[i7];
            }
            double[] arrayOfDouble9;
            arrayOfDouble1 = a(arrayOfDouble9 = a(arrayOfDouble4, arrayOfDouble7, arrayOfDouble1, arrayOfDouble2));
            arrayOfDouble2 = new double[arrayOfDouble6.length];
            for (int i3 = 0; i3 < arrayOfDouble6.length; i3++) {
                arrayOfDouble6[i3] *= arrayOfDouble1[0];
            }
            double[] arrayOfDouble5 = new double[paramArrayOfDouble1.length];
            double[] arrayOfDouble6 = new double[paramArrayOfDouble2.length];
            for (int i6 = 0; i6 < arrayOfDouble5.length; i6++) {
                arrayOfDouble5[i6] = paramArrayOfDouble1[i6];
            }
            for (i6 = 0; i6 < arrayOfDouble6.length; i6++) {
                arrayOfDouble6[i6] = paramArrayOfDouble2[i6];
            }
            double[] arrayOfDouble8;
            paramArrayOfDouble1 = a(arrayOfDouble8 = a(arrayOfDouble5, arrayOfDouble6, arrayOfDouble1, arrayOfDouble2));
            paramArrayOfDouble2 = new double[paramArrayOfDouble3.length];
            paramArrayOfDouble3 = 0;
            for (int n = 0; n < arrayOfDouble1.length; n++) {
                if (((n >= j ? 1 : 0) & (n < k + j ? 1 : 0)) != 0)
                {
                    paramArrayOfDouble2[paramArrayOfDouble3] = paramArrayOfDouble1[n];
                    paramArrayOfDouble3++;
                }
            }
            return paramArrayOfDouble2;
        }

        private  double[] a(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, double[] paramArrayOfDouble3, double[] paramArrayOfDouble4)
        {
            double[] arrayOfDouble1 = new double[paramArrayOfDouble3.length];
            for (int i = 0; i < paramArrayOfDouble3.length; i++) {
                for (int j = 0; ((i >= j ? 1 : 0) & (j < paramArrayOfDouble4.length ? 1 : 0)) != 0; j++) {
                    arrayOfDouble1[i] += paramArrayOfDouble1[j] * paramArrayOfDouble3[(i - j)] - paramArrayOfDouble2[j] * arrayOfDouble1[(i - j)];
                }
            }
            double[] arrayOfDouble2;
            (arrayOfDouble2 = new double[arrayOfDouble1.length])[0] = (arrayOfDouble1[0] + paramArrayOfDouble4[0]);
            int m;
            for (int k = 1; k < paramArrayOfDouble4.length; k++)
            {
                double d1 = 0.0D;
                double d2 = 0.0D;
                for (m = 0; ((k >= m ? 1 : 0) & (m < paramArrayOfDouble4.length ? 1 : 0)) != 0; m++) {
                    d1 += paramArrayOfDouble1[m] * paramArrayOfDouble3[(k - m)];
                }
                for (m = 1; ((k >= m ? 1 : 0) & (m < paramArrayOfDouble4.length ? 1 : 0)) != 0; m++) {
                    d2 += paramArrayOfDouble2[m] * arrayOfDouble2[(k - m)];
                }
                arrayOfDouble2[k] = (d1 - d2 + paramArrayOfDouble4[k]);
            }
            for (k = paramArrayOfDouble4.length; k < arrayOfDouble1.length; k++)
            {
                for (m = 0; m < paramArrayOfDouble4.length; m++) {
                    arrayOfDouble2[k] += paramArrayOfDouble1[m] * paramArrayOfDouble3[(k - m)];
                }
                for (m = 0; m < paramArrayOfDouble4.length; m++) {
                    arrayOfDouble2[k] -= paramArrayOfDouble2[(m + 1)] * arrayOfDouble2[(k - m - 1)];
                }
            }
            return arrayOfDouble2;
        }

        private  double[] a(double[] paramArrayOfDouble)
        {
            double[] arrayOfDouble = new double[paramArrayOfDouble.length];
            for (int i = 0; i < paramArrayOfDouble.length; i++) {
                arrayOfDouble[i] = paramArrayOfDouble[(paramArrayOfDouble.length - 1 - i)];
            }
            return arrayOfDouble;
        }
    }

    public class hjorth
    {
        private double[] a;
        private double[] b;
        private double[] c;
        private double d;
        private double e;
        private double f;
        private double g;
        private double h;
        private double i;

        public hjorth(TF_TD_Libraries paramTF_TD_Libraries) {}

        public TF_TD_Libraries.Hjorth_Return hjorth_fun(double[] paramArrayOfDouble, int paramInt)
        {
            this.a = paramArrayOfDouble;
            Object localObject1 = new TF_TD_Libraries.Diff(this.j);
            this.b = ((TF_TD_Libraries.Diff)localObject1).applydiff(this.a);
            this.c = ((TF_TD_Libraries.Diff)localObject1).applydiff(this.b);
            localObject1 = new double[paramArrayOfDouble = paramArrayOfDouble.length];
            Object localObject2 = new double[paramArrayOfDouble];
            double[] arrayOfDouble = new double[paramArrayOfDouble];
            for (Object localObject3 = 0; localObject3 < paramArrayOfDouble; localObject3++)
            {
                localObject1[localObject3] = this.a[localObject3];
                localObject2[localObject3] = this.b[localObject3];
                arrayOfDouble[localObject3] = this.c[localObject3];
                if (Double.isNaN(localObject1[localObject3])) {
                    localObject1[localObject3] = 0.0D;
                } else {
                    localObject1[localObject3] = 1.0D;
                }
                if (Double.isNaN(localObject2[localObject3])) {
                    localObject2[localObject3] = 0.0D;
                } else {
                    localObject2[localObject3] = 1.0D;
                }
                if (Double.isNaN(arrayOfDouble[localObject3])) {
                    arrayOfDouble[localObject3] = 0.0D;
                } else {
                    arrayOfDouble[localObject3] = 1.0D;
                }
            }
            if (paramInt == 0)
            {
                paramArrayOfDouble = (localObject3 = new TF_TD_Libraries.point_sqr(this.j)).sqr(this.a);
                paramInt = ((TF_TD_Libraries.point_sqr)localObject3).sqr(this.b);
                localObject1 = ((TF_TD_Libraries.point_sqr)localObject3).sqr(this.c);
                localObject2 = new TF_TD_Libraries.calmean(this.j);
                this.d = ((TF_TD_Libraries.calmean)localObject2).mean(paramArrayOfDouble);
                this.e = ((TF_TD_Libraries.calmean)localObject2).mean(paramInt);
                this.f = ((TF_TD_Libraries.calmean)localObject2).mean((double[])localObject1);
                this.g = this.d;
                this.h = Math.sqrt(this.e / this.d);
                this.i = Math.sqrt(this.f / this.e);
            }
            else
            {
                Log.i("Warning", "UC is not correctly assigned");
            }
            return new TF_TD_Libraries.Hjorth_Return(this.j, this.g, this.h, this.i);
        }
    }

    public class Complex
    {
        private double a;
        private double b;
        public  Complex CZero = new Complex(0.0D, 0.0D);
        public  Complex CInfinity = new Complex(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);

        public double getReal()
        {
            return this.a;
        }

        public double getImag()
        {
            return this.b;
        }

        public Complex(double paramDouble1, double paramDouble2)
        {
            this.a = paramDouble1;
            this.b = paramDouble2;
        }

        public  Complex divideOperation(Complex paramComplex, double paramDouble)
        {
            if (paramDouble == 0.0D) {
                return CInfinity;
            }
            double d1 = paramComplex.a / paramDouble;
            double d2 = paramComplex.b / paramDouble;
            return new Complex(d1, d2);
        }

        public  Complex CMultipleValue(Complex paramComplex, double paramDouble)
        {
            return new Complex(paramComplex.a * paramDouble, paramComplex.b * paramDouble);
        }

        public  double CNorm(Complex paramComplex)
        {
            return Math.sqrt(paramComplex.a * paramComplex.a + paramComplex.b * paramComplex.b);
        }

        public  Complex CExp(Complex paramComplex)
        {
            double d1 = paramComplex.a;
            double d2 = paramComplex.b;
            double d3 = Math.exp(d1);
            return new Complex(d3 * Math.cos(d2), d3 * Math.sin(d2));
        }

        public  Complex CLog(Complex paramComplex)
        {
            return new Complex(Math.log(CNorm(paramComplex)), Math.atan2(paramComplex.b, paramComplex.a));
        }

        public  Complex CSqrt(Complex paramComplex)
        {
            return CExp(divideOperation(CLog(paramComplex), 2.0D));
        }
    }

    public class CVector
    {
        private int a;
        private TF_TD_Libraries.Complex[] b;

        public CVector(TF_TD_Libraries paramTF_TD_Libraries, int paramInt)
        {
            this.a = paramInt;
            this.b = new TF_TD_Libraries.Complex[paramInt];
            for (paramTF_TD_Libraries = 0; paramTF_TD_Libraries < paramInt; paramTF_TD_Libraries++) {
                this.b[paramTF_TD_Libraries] = TF_TD_Libraries.Complex.CZero;
            }
        }

        public CVector(TF_TD_Libraries paramTF_TD_Libraries, TF_TD_Libraries.Complex[] paramArrayOfComplex)
        {
            this.a = paramArrayOfComplex.length;
            this.b = paramArrayOfComplex;
        }

        public TF_TD_Libraries.Complex setVector(int paramInt)
        {
            if ((paramInt < 0) || (paramInt > this.a)) {
                Log.i("Exception:", "i is out of range");
            }
            return this.b[paramInt];
        }

        public int GetVectorSize()
        {
            return this.a;
        }
    }

    public class Detrend
    {
        private double a;
        private double[] b;
        private double[] c;
        private double[] d;
        private double[] e;
        private double f;
        private double g;
        private int h;
        private int i;

        public Detrend(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double[] removeLinearTrend(double[] paramArrayOfDouble)
        {
            this.i = paramArrayOfDouble.length;
            this.d = new double[this.i];
            this.e = new double[this.i];
            for (this.h = 0; this.h < this.i; this.h += 1) {
                this.e[this.h] = (this.h + 1);
            }
            this.f = ((a(paramArrayOfDouble) * a(b(this.e)) - a(this.e) * a(a(this.e, paramArrayOfDouble))) / (this.i * a(b(this.e)) - Math.pow(a(this.e), 2.0D)));
            this.g = ((this.i * a(a(this.e, paramArrayOfDouble)) - a(this.e) * a(paramArrayOfDouble)) / (this.i * a(b(this.e)) - Math.pow(a(this.e), 2.0D)));
            for (this.h = 0; this.h < this.i; this.h += 1) {
                this.d[this.h] = (paramArrayOfDouble[this.h] - (this.f + this.g * (this.h + 1.0D)));
            }
            return this.d;
        }

        private double a(double[] paramArrayOfDouble)
        {
            this.a = 0.0D;
            for (int j = 0; j < paramArrayOfDouble.length; j++) {
                this.a += paramArrayOfDouble[j];
            }
            return this.a;
        }

        private double[] a(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
        {
            this.b = new double[paramArrayOfDouble1.length];
            for (int j = 0; j < paramArrayOfDouble1.length; j++) {
                this.b[j] = (paramArrayOfDouble1[j] * paramArrayOfDouble2[j]);
            }
            return this.b;
        }

        private double[] b(double[] paramArrayOfDouble)
        {
            this.c = new double[paramArrayOfDouble.length];
            for (int j = 0; j < paramArrayOfDouble.length; j++) {
                this.c[j] = Math.pow(paramArrayOfDouble[j], 2.0D);
            }
            return this.c;
        }
    }

    public class FeatureExtrationReturn
    {
        protected double _hjorth_activity;
        protected double _hjorth_mobility;
        protected double _hjorth_complexity;
        protected double[] _bp_row_mean;
        protected double[] _rbp_row_mean;
        protected double[] _bp_activity;
        protected double[] _bp_mobility;
        protected double[] _bp_complexity;

        public FeatureExtrationReturn(TF_TD_Libraries paramTF_TD_Libraries, double paramDouble1, double paramDouble2, double paramDouble3, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, double[] paramArrayOfDouble3, double[] paramArrayOfDouble4, double[] paramArrayOfDouble5)
        {
            this._hjorth_activity = paramDouble1;
            this._hjorth_mobility = paramDouble2;
            this._hjorth_complexity = paramDouble3;
            this._bp_row_mean = paramArrayOfDouble1;
            this._rbp_row_mean = paramArrayOfDouble2;
            this._bp_activity = paramArrayOfDouble3;
            this._bp_mobility = paramArrayOfDouble4;
            this._bp_complexity = paramArrayOfDouble5;
        }

        public double get_hjorth_activity()
        {
            return this._hjorth_activity;
        }

        public double get_hjorth_mobility()
        {
            return this._hjorth_mobility;
        }

        public double get_hjorth_complexity()
        {
            return this._hjorth_complexity;
        }

        public double[] get_bp_row_mean()
        {
            return this._bp_row_mean;
        }

        public double[] get_rbp_row_mean()
        {
            return this._rbp_row_mean;
        }

        public double[] get_bp_activity()
        {
            return this._bp_activity;
        }

        public double[] get_bp_mobility()
        {
            return this._bp_mobility;
        }

        public double[] get_bp_complexity()
        {
            return this._bp_complexity;
        }
    }

    public class Hjorth_Filter
    {
        public Hjorth_Filter(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double[] Applyfilter(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, double[] paramArrayOfDouble3)
        {
            double d1 = paramArrayOfDouble2.length - 1;
            double d2;
            int i = (d2 = paramArrayOfDouble3.length - 1) + 1;
            double d3;
            if (paramArrayOfDouble2[0] != 1.0D) {
                for (int j = 0; j < d1 + 1; j++)
                {
                    d3 = paramArrayOfDouble2[0];
                    paramArrayOfDouble1[j] /= d3;
                    paramArrayOfDouble2[j] /= d3;
                    paramArrayOfDouble2[0] = d3;
                }
            }
            double[] arrayOfDouble = new double[i];
            if (d2 < d1) {
                for (d3 = d2; d3 < d1; d3++)
                {
                    paramArrayOfDouble3[d3] = 0.0D;
                    d2 = d1;
                }
            }
            for (double d4 = 0; d4 < d2 + 1; d4++) {
                arrayOfDouble[d4] = 0.0D;
            }
            paramArrayOfDouble1[0] *= paramArrayOfDouble3[0];
            for (d4 = 1; d4 < d1; d4++)
            {
                arrayOfDouble[d4] = 0.0D;
                for (double d6 = 0; d6 < d4 + 1; d6++) {
                    arrayOfDouble[d4] += paramArrayOfDouble1[d6] * paramArrayOfDouble3[(d4 - d6)];
                }
                for (double d7 = 0; d7 < d4; d7++) {
                    arrayOfDouble[d4] -= paramArrayOfDouble2[(d7 + 1)] * arrayOfDouble[(d4 - d7 - 1)];
                }
            }
            for (double d5 = d1; d5 < d2 + 1; d5++)
            {
                arrayOfDouble[d5] = 0.0D;
                for (int k = 0; k < d1 + 1; k++) {
                    arrayOfDouble[d5] += paramArrayOfDouble1[k] * paramArrayOfDouble3[(d5 - k)];
                }
                for (double d8 = 0; d8 < d1; d8++) {
                    arrayOfDouble[d5] -= paramArrayOfDouble2[(d8 + 1)] * arrayOfDouble[(d5 - d8 - 1)];
                }
            }
            return arrayOfDouble;
        }
    }

    public class Hjorth_Return
    {
        protected double _activity_UC0;
        protected double _mobility_UC0;
        protected double _complexity_UC0;

        public Hjorth_Return(TF_TD_Libraries paramTF_TD_Libraries, double paramDouble1, double paramDouble2, double paramDouble3)
        {
            this._activity_UC0 = paramDouble1;
            this._mobility_UC0 = paramDouble2;
            this._complexity_UC0 = paramDouble3;
        }

        public double get_activity()
        {
            return this._activity_UC0;
        }

        public double get_mobility()
        {
            return this._mobility_UC0;
        }

        public double get_complexity()
        {
            return this._complexity_UC0;
        }
    }

    public class point_div
    {
        public int row;

        public point_div(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double[] div(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
        {
            Object localObject = new TF_TD_Libraries.Diff(this.a);
            this.row = ((TF_TD_Libraries.Diff)localObject).return_row(paramArrayOfDouble1, this.row);
            localObject = new double[this.row];
            for (int i = 0; i < this.row; i++) {
                paramArrayOfDouble1[i] /= paramArrayOfDouble2[i];
            }
            return (double[])localObject;
        }
    }

    public class point_sqr
    {
        public int row;

        public point_sqr(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double[] sqr(double[] paramArrayOfDouble)
        {
            Object localObject = new TF_TD_Libraries.Diff(this.a);
            this.row = ((TF_TD_Libraries.Diff)localObject).return_row(paramArrayOfDouble, this.row);
            localObject = new double[this.row];
            for (int i = 0; i < this.row; i++) {
                paramArrayOfDouble[i] *= paramArrayOfDouble[i];
            }
            return (double[])localObject;
        }
    }

    public class TF_TD_eyeblink_v2
    {
        public TF_TD_eyeblink_v2(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double[] eyeblinkv2_fun(double[] paramArrayOfDouble)
        {
            int i;
            double d;
            int j = (int)Math.ceil(Math.log(d = i = paramArrayOfDouble.length) / Math.log(2.0D));
            double[] arrayOfDouble1 = new double[j = (int)Math.pow(2.0D, j)];
            int n = paramArrayOfDouble.length;
            for (int i1 = 0; i1 < n; i1++) {
                arrayOfDouble1[i1] = paramArrayOfDouble[i1];
            }
            double[] arrayOfDouble2 = new double[arrayOfDouble1.length];
            for (paramArrayOfDouble = 0; paramArrayOfDouble < arrayOfDouble2.length; paramArrayOfDouble++) {
                arrayOfDouble2[paramArrayOfDouble] = arrayOfDouble1[paramArrayOfDouble];
            }
            int k = (paramArrayOfDouble = (paramArrayOfDouble = new TF_TD_Libraries.TF_TD_eyeblink_v2.SWT(this)).SWT_Fun(arrayOfDouble1, 5, "coif3")).length;
            int i3 = paramArrayOfDouble[0].length;
            Object localObject2 = new double[k][i3];
            for (int i4 = 0; i4 < i3; i4++) {
                if (((i4 < i ? 1 : 0) & (Math.abs(paramArrayOfDouble[0][i4]) > 87.0D ? 1 : 0)) != 0) {
                    localObject2[0][i4] = 0.0D;
                } else {
                    localObject2[0][i4] = paramArrayOfDouble[0][i4];
                }
            }
            for (i4 = 0; i4 < i3; i4++) {
                if (((i4 < i ? 1 : 0) & (Math.abs(paramArrayOfDouble[1][i4]) > 120.0D ? 1 : 0)) != 0) {
                    localObject2[1][i4] = 0.0D;
                } else {
                    localObject2[1][i4] = paramArrayOfDouble[1][i4];
                }
            }
            for (i4 = 0; i4 < i3; i4++) {
                if (((i4 < i ? 1 : 0) & (Math.abs(paramArrayOfDouble[2][i4]) > 188.0D ? 1 : 0)) != 0) {
                    localObject2[2][i4] = 0.0D;
                } else {
                    localObject2[2][i4] = paramArrayOfDouble[2][i4];
                }
            }
            for (i4 = 0; i4 < i3; i4++) {
                if (((i4 < i ? 1 : 0) & (Math.abs(paramArrayOfDouble[3][i4]) > 253.0D ? 1 : 0)) != 0) {
                    localObject2[3][i4] = 0.0D;
                } else {
                    localObject2[3][i4] = paramArrayOfDouble[3][i4];
                }
            }
            for (i4 = 0; i4 < i3; i4++) {
                if (((i4 < i ? 1 : 0) & (Math.abs(paramArrayOfDouble[4][i4]) > 477.0D ? 1 : 0)) != 0) {
                    localObject2[4][i4] = 0.0D;
                } else {
                    localObject2[4][i4] = paramArrayOfDouble[4][i4];
                }
            }
            for (i4 = 0; i4 < i3; i4++) {
                if (((i4 < i ? 1 : 0) & (Math.abs(paramArrayOfDouble[5][i4]) > 1207.0D ? 1 : 0)) != 0) {
                    localObject2[5][i4] = 0.0D;
                } else {
                    localObject2[5][i4] = paramArrayOfDouble[5][i4];
                }
            }
            TF_TD_Libraries.TF_TD_eyeblink_v2.ISWT localISWT;
            paramArrayOfDouble = (localISWT = new TF_TD_Libraries.TF_TD_eyeblink_v2.ISWT(this)).ISWT_Fun((double[][])localObject2);
            localObject2 = (localObject1 = new TF_TD_Libraries.Detrend(this.a)).removeLinearTrend(arrayOfDouble2);
            paramArrayOfDouble = ((TF_TD_Libraries.Detrend)localObject1).removeLinearTrend(paramArrayOfDouble);
            Object localObject1 = new double[localObject2.length];
            int i2 = localObject2.length;
            TF_TD_Libraries.TF_TD_eyeblink_v2.FFT localFFT;
            localObject2 = (localFFT = new TF_TD_Libraries.TF_TD_eyeblink_v2.FFT(this)).calculateFFT((double[])localObject2, (double[])localObject1, 1, i2);
            localObject1 = localFFT.calculateFFT(paramArrayOfDouble, (double[])localObject1, 1, i2);
            ((TF_TD_Libraries.TF_TD_eyeblink_v2.FFTResult)localObject2).getPower();
            ((TF_TD_Libraries.TF_TD_eyeblink_v2.FFTResult)localObject1).getPower();
            localObject1 = new double[n];
            for (int m = 0; m < n; m++) {
                localObject1[m] = paramArrayOfDouble[m];
            }
            return (double[])localObject1;
        }

        public class FFT
        {
            private double[] a;
            private double[] b;

            public FFT(TF_TD_Libraries.TF_TD_eyeblink_v2 paramTF_TD_eyeblink_v2) {}

            public TF_TD_Libraries.TF_TD_eyeblink_v2.FFTResult calculateFFT(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, int paramInt1, int paramInt2)
            {
                this.a = new double[paramInt2];
                this.b = new double[paramInt2];
                System.arraycopy(paramArrayOfDouble1, 0, this.a, 0, Math.min(paramArrayOfDouble1.length, paramInt2));
                System.arraycopy(paramArrayOfDouble2, 0, this.b, 0, Math.min(paramArrayOfDouble2.length, paramInt2));
                double[] arrayOfDouble4 = (int)(Math.log(this.a.length) / Math.log(2.0D));
                paramArrayOfDouble1 = 1;
                for (paramArrayOfDouble2 = 0; paramArrayOfDouble2 < arrayOfDouble4; paramArrayOfDouble2++) {
                    paramArrayOfDouble1 <<= 1;
                }
                double[] arrayOfDouble2 = paramArrayOfDouble1 >> 1;
                double[] arrayOfDouble1 = 0;
                int i;
                for (paramArrayOfDouble2 = 0; paramArrayOfDouble2 < paramArrayOfDouble1 - 1; paramArrayOfDouble2++)
                {
                    if (paramArrayOfDouble2 < arrayOfDouble1)
                    {
                        double d3 = this.a[paramArrayOfDouble2];
                        double d4 = this.b[paramArrayOfDouble2];
                        this.a[paramArrayOfDouble2] = this.a[arrayOfDouble1];
                        this.b[paramArrayOfDouble2] = this.b[arrayOfDouble1];
                        this.a[arrayOfDouble1] = d3;
                        this.b[arrayOfDouble1] = d4;
                    }
                    paramInt2 = arrayOfDouble2;
                    while (paramInt2 <= arrayOfDouble1)
                    {
                        arrayOfDouble1 -= paramInt2;
                        paramInt2 >>= 1;
                    }
                    i += paramInt2;
                }
                double d1 = -1.0D;
                double d2 = 0.0D;
                double[] arrayOfDouble3 = 1;
                for (arrayOfDouble2 = 0; arrayOfDouble2 < arrayOfDouble4; arrayOfDouble2++)
                {
                    int j = arrayOfDouble3;
                    arrayOfDouble3 <<= 1;
                    double d7 = 1.0D;
                    double d8 = 0.0D;
                    for (i = 0; i < j; i++)
                    {
                        paramArrayOfDouble2 = i;
                        while (paramArrayOfDouble2 < paramArrayOfDouble1)
                        {
                            paramInt2 = paramArrayOfDouble2 + j;
                            double d5 = d7 * this.a[paramInt2] - d8 * this.b[paramInt2];
                            double d6 = d7 * this.b[paramInt2] + d8 * this.a[paramInt2];
                            this.a[paramArrayOfDouble2] -= d5;
                            this.b[paramArrayOfDouble2] -= d6;
                            this.a[paramArrayOfDouble2] += d5;
                            this.b[paramArrayOfDouble2] += d6;
                            paramArrayOfDouble2 += arrayOfDouble3;
                        }
                        double d9 = d7 * d1 - d8 * d2;
                        d8 = d7 * d2 + d8 * d1;
                        d7 = d9;
                    }
                    d2 = Math.sqrt((1.0D - d1) / 2.0D);
                    if (paramInt1 == 1) {
                        d2 = -d2;
                    }
                    d1 = Math.sqrt((d1 + 1.0D) / 2.0D);
                }
                if (paramInt1 == -1) {
                    for (paramArrayOfDouble2 = 0; paramArrayOfDouble2 < paramArrayOfDouble1; paramArrayOfDouble2++)
                    {
                        this.a[paramArrayOfDouble2] /= paramArrayOfDouble1;
                        this.b[paramArrayOfDouble2] /= paramArrayOfDouble1;
                    }
                }
                return new TF_TD_Libraries.TF_TD_eyeblink_v2.FFTResult(this.c, this.a, this.b);
            }
        }

        public class FFTResult
        {
            protected double[] real;
            protected double[] imaginary;
            protected double[] power;

            public FFTResult(TF_TD_Libraries.TF_TD_eyeblink_v2 paramTF_TD_eyeblink_v2, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
            {
                this.real = paramArrayOfDouble1;
                this.imaginary = paramArrayOfDouble2;
                this.power = a();
            }

            public double[] getReal()
            {
                return this.real;
            }

            public double[] getImaginary()
            {
                return this.imaginary;
            }

            public double[] getPower()
            {
                return this.power;
            }

            private double[] a()
            {
                this.power = new double[this.real.length];
                for (int i = 0; i < this.power.length; i++) {
                    this.power[i] = Math.pow(Math.pow(Math.abs(this.real[i]), 2.0D) + Math.pow(Math.abs(this.imaginary[i]), 2.0D), 0.5D);
                }
                return this.power;
            }
        }

        public class ISWT
        {
            private double[] a;
            private double[] b;
            private double[] c;
            private int d;
            private int e;
            private int f;
            private int g;
            private double[][] h;
            private double[] i;
            private double[] j;
            private double[] k;
            private double[] l;
            private double m;
            private double n;
            private double[] o;
            private double[] p;
            private double[] q;
            private double[] r;
            private double[] s;
            private double[] t;
            private double[] u;
            private double[] v;
            private double[] w;

            public ISWT(TF_TD_Libraries.TF_TD_eyeblink_v2 paramTF_TD_eyeblink_v2) {}

            public double[] ISWT_Fun(double[][] paramArrayOfDouble)
            {
                this.b = new double[] { -0.003793512864491D, 0.007782596427325D, 0.023452696141836D, -0.065771911281856D, -0.061123390002673D, 0.405176902409617D, 0.793777222625621D, 0.428483476377619D, -0.071799821619312D, -0.082301927106886D, 0.034555027573062D, 0.015880544863616D, -0.009007976136662D, -0.00257451768875D, 0.001117518770891D, 4.662169601128863E-4D, -7.098330313814125E-5D, -3.459977283621256E-5D };
                this.c = new double[] { -3.459977283621256E-5D, 7.098330313814125E-5D, 4.662169601128863E-4D, -0.001117518770891D, -0.00257451768875D, 0.009007976136662D, 0.015880544863616D, -0.034555027573062D, -0.082301927106886D, 0.071799821619312D, 0.428483476377619D, -0.793777222625621D, 0.405176902409617D, 0.061123390002673D, -0.065771911281856D, -0.023452696141836D, 0.007782596427325D, 0.003793512864491D };
                this.d = paramArrayOfDouble.length;
                Log.i("p = ", String.valueOf(this.d));
                this.e = (this.d - 1);
                this.h = new double[this.e][paramArrayOfDouble[0].length];
                for (int i1 = 0; i1 < this.e; i1++) {
                    for (int i2 = 0; i2 < paramArrayOfDouble[0].length; i2++) {
                        this.h[i1][i2] = paramArrayOfDouble[i1][i2];
                    }
                }
                this.i = new double[paramArrayOfDouble[0].length];
                for (i1 = 0; i1 < paramArrayOfDouble[0].length; i1++) {
                    this.i[i1] = paramArrayOfDouble[(this.d - 1)][i1];
                }
                this.e = this.h.length;
                this.f = this.h[0].length;
                for (i1 = this.e; i1 > 0; i1--)
                {
                    this.m = Math.pow(2.0D, i1 - 1);
                    this.n = this.m;
                    for (double d1 = 1.0D; d1 <= this.n; d1 += 1.0D)
                    {
                        paramArrayOfDouble = 0;
                        this.j = new double[(int)(Math.floor((this.f - d1) / this.m) + 1.0D)];
                        for (double d2 = d1; d2 <= this.f; d2 += this.m)
                        {
                            this.j[paramArrayOfDouble] = d2;
                            paramArrayOfDouble++;
                        }
                        this.g = this.j.length;
                        paramArrayOfDouble = 0;
                        this.k = new double[(int)(Math.floor((this.g - 1.0D) / 2.0D) + 1.0D)];
                        int i5 = 0;
                        while (i5 < this.g - 1)
                        {
                            this.k[paramArrayOfDouble] = this.j[i5];
                            paramArrayOfDouble += 1;
                            i5 += 2;
                        }
                        this.v = new double[this.k.length];
                        for (i5 = 0; i5 < this.k.length; i5++)
                        {
                            i7 = (int)this.k[i5];
                            this.v[i5] = this.i[(i7 - 1)];
                        }
                        this.w = new double[this.k.length];
                        for (i5 = 0; i5 < this.k.length; i5++)
                        {
                            i7 = (int)this.k[i5];
                            this.w[i5] = this.h[(i1 - 1)][(i7 - 1)];
                        }
                        double[] arrayOfDouble2 = a(this.v, this.w, this.b, this.c, this.g, 0.0D);
                        paramArrayOfDouble = 0;
                        this.l = new double[(int)(Math.floor((this.g - 2.0D) / 2.0D) + 1.0D)];
                        int i7 = 1;
                        while (i7 < this.g)
                        {
                            this.l[paramArrayOfDouble] = this.j[i7];
                            paramArrayOfDouble += 1;
                            i7 += 2;
                        }
                        double[] arrayOfDouble3 = new double[this.l.length];
                        for (paramArrayOfDouble = 0; paramArrayOfDouble < this.l.length; paramArrayOfDouble++)
                        {
                            i3 = (int)this.l[paramArrayOfDouble];
                            arrayOfDouble3[paramArrayOfDouble] = this.i[(i3 - 1)];
                        }
                        paramArrayOfDouble = new double[this.l.length];
                        for (int i3 = 0; i3 < this.l.length; i3++)
                        {
                            int i8 = (int)this.l[i3];
                            paramArrayOfDouble[i3] = this.h[(i1 - 1)][(i8 - 1)];
                        }
                        double[] arrayOfDouble1 = a(arrayOfDouble3, paramArrayOfDouble, this.b, this.c, this.g, -1.0D);
                        double d3 = 0.5D;
                        arrayOfDouble1 = a(arrayOfDouble2, arrayOfDouble1);
                        paramArrayOfDouble = this;
                        this.u = new double[arrayOfDouble1.length];
                        for (int i6 = 0; i6 < arrayOfDouble1.length; i6++) {
                            paramArrayOfDouble.u[i6] = (arrayOfDouble1[i6] * 0.5D);
                        }
                        double[] arrayOfDouble4 = paramArrayOfDouble.u;
                        for (paramArrayOfDouble = 0; paramArrayOfDouble < this.j.length; paramArrayOfDouble++)
                        {
                            int i4 = (int)this.j[paramArrayOfDouble];
                            this.i[(i4 - 1)] = arrayOfDouble4[paramArrayOfDouble];
                        }
                    }
                }
                this.a = new double[this.i.length];
                for (i1 = 0; i1 < this.i.length; i1++) {
                    this.a[i1] = this.i[i1];
                }
                return this.a;
            }

            private double[] a(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, double[] paramArrayOfDouble3, double[] paramArrayOfDouble4, int paramInt, double paramDouble)
            {
                paramArrayOfDouble1 = a(paramArrayOfDouble1, paramArrayOfDouble3, paramInt);
                paramArrayOfDouble2 = a(paramArrayOfDouble2, paramArrayOfDouble4, paramInt);
                if (paramDouble == 0.0D)
                {
                    this.r = a(paramArrayOfDouble1, paramArrayOfDouble2);
                }
                else
                {
                    paramArrayOfDouble1 = a(paramArrayOfDouble1, paramArrayOfDouble2);
                    this.r = new double[paramArrayOfDouble1.length];
                    for (paramArrayOfDouble2 = 0; paramArrayOfDouble2 < paramArrayOfDouble1.length; paramArrayOfDouble2++) {
                        if (paramArrayOfDouble2 == 0) {
                            this.r[paramArrayOfDouble2] = paramArrayOfDouble1[(paramArrayOfDouble1.length - 1)];
                        } else {
                            this.r[paramArrayOfDouble2] = paramArrayOfDouble1[(paramArrayOfDouble2 - 1)];
                        }
                    }
                }
                return this.r;
            }

            private double[] a(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
            {
                this.t = new double[paramArrayOfDouble1.length];
                for (int i1 = 0; i1 < paramArrayOfDouble1.length; i1++) {
                    this.t[i1] = (paramArrayOfDouble1[i1] + paramArrayOfDouble2[i1]);
                }
                return this.t;
            }

            /* Error */
            private double[] a(double[] arg1, double[] arg2, int arg3)
            {
                // Byte code:
                //   0: aload_2
                //   1: arraylength
                //   2: istore 4
                //   4: aload_0
                //   5: aload_0
                //   6: aload_0
                //   7: aload_0
                //   8: aload_1
                //   9: astore 5
                //   11: astore_1
                //   12: iconst_2
                //   13: aload 5
                //   15: arraylength
                //   16: imul
                //   17: istore 6
                //   19: aload_1
                //   20: iload 6
                //   22: newarray <illegal type>
                //   24: putfield 84	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:q	[D
                //   27: iconst_0
                //   28: istore 7
                //   30: iconst_0
                //   31: istore 8
                //   33: iload 8
                //   35: iload 6
                //   37: if_icmpge +30 -> 67
                //   40: aload_1
                //   41: getfield 84	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:q	[D
                //   44: iload 8
                //   46: aload 5
                //   48: iload 7
                //   50: daload
                //   51: dastore
                //   52: iload 7
                //   54: iconst_1
                //   55: iadd
                //   56: istore 7
                //   58: iload 8
                //   60: iconst_2
                //   61: iadd
                //   62: istore 8
                //   64: goto -31 -> 33
                //   67: aload_1
                //   68: getfield 84	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:q	[D
                //   71: iload 4
                //   73: iconst_2
                //   74: idiv
                //   75: istore 6
                //   77: astore 5
                //   79: astore_1
                //   80: aload 5
                //   82: arraylength
                //   83: dup
                //   84: istore 7
                //   86: iload 6
                //   88: isub
                //   89: iconst_1
                //   90: iadd
                //   91: istore 8
                //   93: aload_1
                //   94: aload 5
                //   96: arraylength
                //   97: iconst_2
                //   98: iload 6
                //   100: imul
                //   101: iadd
                //   102: newarray <illegal type>
                //   104: putfield 82	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:o	[D
                //   107: iconst_0
                //   108: istore 9
                //   110: iload 9
                //   112: iload 6
                //   114: if_icmpge +25 -> 139
                //   117: aload_1
                //   118: getfield 82	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:o	[D
                //   121: iload 9
                //   123: iload 8
                //   125: i2d
                //   126: dastore
                //   127: iload 8
                //   129: iconst_1
                //   130: iadd
                //   131: istore 8
                //   133: iinc 9 1
                //   136: goto -26 -> 110
                //   139: iconst_0
                //   140: istore 9
                //   142: iload 9
                //   144: iload 7
                //   146: if_icmpge +24 -> 170
                //   149: aload_1
                //   150: getfield 82	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:o	[D
                //   153: iload 9
                //   155: iload 6
                //   157: iadd
                //   158: iload 9
                //   160: iconst_1
                //   161: iadd
                //   162: i2d
                //   163: dastore
                //   164: iinc 9 1
                //   167: goto -25 -> 142
                //   170: iconst_0
                //   171: istore 9
                //   173: iload 9
                //   175: iload 6
                //   177: if_icmpge +27 -> 204
                //   180: aload_1
                //   181: getfield 82	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:o	[D
                //   184: iload 9
                //   186: iload 6
                //   188: iadd
                //   189: iload 7
                //   191: iadd
                //   192: iload 9
                //   194: iconst_1
                //   195: iadd
                //   196: i2d
                //   197: dastore
                //   198: iinc 9 1
                //   201: goto -28 -> 173
                //   204: aload_1
                //   205: getfield 82	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:o	[D
                //   208: arraylength
                //   209: newarray <illegal type>
                //   211: astore 9
                //   213: iconst_0
                //   214: istore 6
                //   216: iload 6
                //   218: aload_1
                //   219: getfield 82	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:o	[D
                //   222: arraylength
                //   223: if_icmpge +31 -> 254
                //   226: aload_1
                //   227: getfield 82	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:o	[D
                //   230: iload 6
                //   232: daload
                //   233: d2i
                //   234: istore 7
                //   236: aload 9
                //   238: iload 6
                //   240: aload 5
                //   242: iload 7
                //   244: iconst_1
                //   245: isub
                //   246: daload
                //   247: dastore
                //   248: iinc 6 1
                //   251: goto -35 -> 216
                //   254: aload 9
                //   256: aload_2
                //   257: astore 5
                //   259: dup
                //   260: astore_1
                //   261: arraylength
                //   262: aload 5
                //   264: arraylength
                //   265: iadd
                //   266: iconst_1
                //   267: isub
                //   268: newarray <illegal type>
                //   270: astore 7
                //   272: iconst_0
                //   273: istore 8
                //   275: iload 8
                //   277: aload_1
                //   278: arraylength
                //   279: if_icmpge +47 -> 326
                //   282: iconst_0
                //   283: istore 9
                //   285: iload 9
                //   287: aload 5
                //   289: arraylength
                //   290: if_icmpge +30 -> 320
                //   293: aload 7
                //   295: iload 8
                //   297: iload 9
                //   299: iadd
                //   300: dup2
                //   301: daload
                //   302: aload_1
                //   303: iload 8
                //   305: daload
                //   306: aload 5
                //   308: iload 9
                //   310: daload
                //   311: dmul
                //   312: dadd
                //   313: dastore
                //   314: iinc 9 1
                //   317: goto -32 -> 285
                //   320: iinc 8 1
                //   323: goto -48 -> 275
                //   326: aload 7
                //   328: iload_3
                //   329: iload 4
                //   331: istore 7
                //   333: istore 6
                //   335: astore 5
                //   337: dup
                //   338: astore_1
                //   339: iload 6
                //   341: newarray <illegal type>
                //   343: putfield 83	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:p	[D
                //   346: iconst_0
                //   347: istore 8
                //   349: iload 7
                //   351: iconst_1
                //   352: isub
                //   353: istore 9
                //   355: iload 9
                //   357: iload 7
                //   359: iload 6
                //   361: iadd
                //   362: iconst_2
                //   363: isub
                //   364: if_icmpgt +27 -> 391
                //   367: aload_1
                //   368: getfield 83	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:p	[D
                //   371: iload 8
                //   373: aload 5
                //   375: iload 9
                //   377: daload
                //   378: dastore
                //   379: iload 8
                //   381: iconst_1
                //   382: iadd
                //   383: istore 8
                //   385: iinc 9 1
                //   388: goto -33 -> 355
                //   391: aload_1
                //   392: getfield 83	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:p	[D
                //   395: putfield 86	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:s	[D
                //   398: aload_0
                //   399: getfield 86	com/neurosky/thinkgear/TF_TD_Libraries$TF_TD_eyeblink_v2$ISWT:s	[D
                //   402: areturn
            }
        }


        public class SWT
        {
            private double[] a;
            private double[] b;
            private double[] c;
            private double[] d;
            private double[] e;
            private double[] f;
            private double[] g;
            private int h;
            private double[][] i;
            private double[][] j;
            private double[] k;
            private double[] l;
            private double[] m;
            private double[][] n;

            public SWT(TF_TD_Libraries.TF_TD_eyeblink_v2 paramTF_TD_eyeblink_v2) {}

            public double[][] SWT_Fun(double[] paramArrayOfDouble, int paramInt, String paramString)
            {
                this.h = paramArrayOfDouble.length;
                if (paramString != "coif3") {
                    Log.i("Warning", "No such wavelet type");
                }
                this.a = new double[] { -3.459977283621256E-5D, -7.098330313814125E-5D, 4.662169601128863E-4D, 0.001117518770891D, -0.00257451768875D, -0.009007976136662D, 0.015880544863616D, 0.034555027573062D, -0.082301927106886D, -0.071799821619312D, 0.428483476377619D, 0.793777222625621D, 0.405176902409617D, -0.061123390002673D, -0.065771911281856D, 0.023452696141836D, 0.007782596427325D, -0.003793512864491D };
                this.b = new double[] { 0.003793512864491D, 0.007782596427325D, -0.023452696141836D, -0.065771911281856D, 0.061123390002673D, 0.405176902409617D, -0.793777222625621D, 0.428483476377619D, 0.071799821619312D, -0.082301927106886D, -0.034555027573062D, 0.015880544863616D, 0.009007976136662D, -0.00257451768875D, -0.001117518770891D, 4.662169601128863E-4D, 7.098330313814125E-5D, -3.459977283621256E-5D };
                this.i = new double[paramInt][this.h];
                this.j = new double[paramInt][this.h];
                int i1;
                for (paramString = 0; paramString < paramInt; paramString++)
                {
                    i1 = this.a.length;
                    int i2 = i1 / 2;
                    double[] arrayOfDouble1 = paramArrayOfDouble;
                    SWT localSWT = this;
                    int i4 = (i3 = arrayOfDouble1.length) - i2 + 1;
                    localSWT.k = new double[arrayOfDouble1.length + 2 * i2];
                    int i5 = 0;
                    localSWT.k[i5] = i4;
                    i4 += 1;
                    i5 = 0;
                    localSWT.k[(i5 + i2)] = (i5 + 1);
                    i5 = 0;
                    localSWT.k[(i5 + i2 + i3)] = (i5 + 1);
                    double[] arrayOfDouble2 = new double[localSWT.k.length];
                    i2 = 0;
                    int i3 = (int)localSWT.k[i2];
                    arrayOfDouble2[i2] = arrayOfDouble1[(i3 - 1)];
                    this.c = arrayOfDouble2;
                    this.d = a(this.c, this.b);
                    this.e = a(this.c, this.a);
                    this.f = a(this.d, this.h, i1 + 1);
                    this.g = a(this.e, this.h, i1 + 1);
                    for (i1 = 0; i1 < this.f.length; i1++) {
                        this.i[paramString][i1] = this.f[i1];
                    }
                    for (i1 = 0; i1 < this.g.length; i1++) {
                        this.j[paramString][i1] = this.g[i1];
                    }
                    this.a = a(this.a);
                    this.b = a(this.b);
                    for (i1 = 0; i1 < paramArrayOfDouble.length; i1++) {
                        paramArrayOfDouble[i1] = this.j[paramString][i1];
                    }
                }
                this.n = new double[paramInt + 1][paramArrayOfDouble.length];
                for (paramString = 0; paramString < paramInt; paramString++) {
                    for (i1 = 0; i1 < paramArrayOfDouble.length; i1++) {
                        this.n[paramString][i1] = this.i[paramString][i1];
                    }
                }
                for (paramString = 0; paramString < paramArrayOfDouble.length; paramString++) {
                    this.n[paramInt][paramString] = this.j[(paramInt - 1)][paramString];
                }
                return this.n;
            }

            private static double[] a(double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
            {
                double[] arrayOfDouble = new double[paramArrayOfDouble1.length + paramArrayOfDouble2.length - 1];
                for (int i1 = 0; i1 < paramArrayOfDouble1.length; i1++) {
                    for (int i2 = 0; i2 < paramArrayOfDouble2.length; i2++) {
                        arrayOfDouble[(i1 + i2)] += paramArrayOfDouble1[i1] * paramArrayOfDouble2[i2];
                    }
                }
                return arrayOfDouble;
            }

            private double[] a(double[] paramArrayOfDouble, int paramInt1, int paramInt2)
            {
                this.l = new double[paramInt1];
                int i1 = 0;
                for (int i2 = paramInt2 - 1; i2 <= paramInt2 + paramInt1 - 2; i2++)
                {
                    this.l[i1] = paramArrayOfDouble[i2];
                    i1 += 1;
                }
                return this.l;
            }

            private double[] a(double[] paramArrayOfDouble)
            {
                int i1 = 2 * paramArrayOfDouble.length;
                this.m = new double[i1];
                int i2 = 0;
                int i3 = 0;
                while (i3 < i1)
                {
                    this.m[i3] = paramArrayOfDouble[i2];
                    i2 += 1;
                    i3 += 2;
                }
                return this.m;
            }
        }

    }

    public class TF_TD_FEATUREEXTRACTION
    {
        public TF_TD_FEATUREEXTRACTION(TF_TD_Libraries paramTF_TD_Libraries) {}

        public TF_TD_Libraries.FeatureExtrationReturn
            TF_TD_featureextraction(double[] paramArrayOfDouble,
                                    int paramInt1, int paramInt2, int paramInt3)
        {
            Object localObject;
            double d1 = (localObject = (localObject = new TF_TD_Libraries.hjorth(this.a)).hjorth_fun(paramArrayOfDouble, 0)).get_activity();
            double d2 = ((TF_TD_Libraries.Hjorth_Return)localObject).get_mobility();
            double d3 = ((TF_TD_Libraries.Hjorth_Return)localObject).get_complexity();
            paramInt1 = (paramArrayOfDouble = (localObject = new TF_TD_Libraries.BandPower(this.a)).Bandpower_fun(paramArrayOfDouble, paramInt1, paramInt2, paramInt3)).get_bp();
            paramInt2 = paramArrayOfDouble.get_rbp();
            paramArrayOfDouble = paramArrayOfDouble.get_bs();
            paramInt3 = paramInt1.length;
            int i = paramInt1[0].length;
            double[] arrayOfDouble1 = new double[paramInt3];
            for (int j = 0; j < paramInt3; j++)
            {
                double d4 = 0.0D;
                for (k = 0; k < i; k++) {
                    d4 += paramInt1[j][k];
                }
                arrayOfDouble1[j] = (d4 / i);
            }
            j = paramInt2.length;
            int m = paramInt2[0].length;
            double[] arrayOfDouble3 = new double[j];
            for (int k = 0; k < j; k++)
            {
                double d5 = 0.0D;
                for (paramInt1 = 0; paramInt1 < m; paramInt1++) {
                    d5 += paramInt2[k][paramInt1];
                }
                arrayOfDouble3[k] = (d5 / m);
            }
            for (k = 0; k < arrayOfDouble1.length; k++) {
                if (Double.isInfinite(arrayOfDouble1[k])) {
                    arrayOfDouble1[k] = 0.0D;
                }
            }
            for (k = 0; k < arrayOfDouble1.length; k++) {
                if (Double.isNaN(arrayOfDouble1[k])) {
                    arrayOfDouble1[k] = 0.0D;
                }
            }
            for (k = 0; k < arrayOfDouble3.length; k++) {
                if (Double.isInfinite(arrayOfDouble3[k])) {
                    arrayOfDouble3[k] = 0.0D;
                }
            }
            for (k = 0; k < arrayOfDouble3.length; k++) {
                if (Double.isNaN(arrayOfDouble3[k])) {
                    arrayOfDouble3[k] = 0.0D;
                }
            }
            double[] arrayOfDouble2 = paramArrayOfDouble;
            int i1;
            for (int n = 0; n < arrayOfDouble2.length; n++) {
                for (i1 = 0; i1 < arrayOfDouble2[0].length; i1++) {
                    if (Double.isInfinite(arrayOfDouble2[n][i1])) {
                        arrayOfDouble2[n][i1] = 0.0D;
                    }
                }
            }
            for (n = 0; n < arrayOfDouble2.length; n++) {
                for (i1 = 0; i1 < arrayOfDouble2[0].length; i1++) {
                    if (Double.isNaN(arrayOfDouble2[n][i1])) {
                        arrayOfDouble2[n][i1] = 0.0D;
                    }
                }
            }
            double[] arrayOfDouble4 = new double[arrayOfDouble2.length];
            double[] arrayOfDouble5 = new double[arrayOfDouble2.length];
            paramInt1 = new double[arrayOfDouble2.length];
            for (paramArrayOfDouble = 0; paramArrayOfDouble < arrayOfDouble2.length; paramArrayOfDouble++)
            {
                paramInt2 = new double[arrayOfDouble2[0].length];
                for (paramInt3 = 0; paramInt3 < arrayOfDouble2[0].length; paramInt3++) {
                    paramInt2[paramInt3] = arrayOfDouble2[paramArrayOfDouble][paramInt3];
                }
                paramInt2 = (paramInt3 = new TF_TD_Libraries.hjorth(this.a)).hjorth_fun(paramInt2, 0);
                arrayOfDouble4[paramArrayOfDouble] = paramInt2.get_activity();
                arrayOfDouble5[paramArrayOfDouble] = paramInt2.get_mobility();
                paramInt1[paramArrayOfDouble] = paramInt2.get_complexity();
            }
            for (paramArrayOfDouble = 0; paramArrayOfDouble < arrayOfDouble4.length; paramArrayOfDouble++) {
                if (Double.isInfinite(arrayOfDouble4[paramArrayOfDouble])) {
                    arrayOfDouble4[paramArrayOfDouble] = 0.0D;
                }
            }
            for (paramArrayOfDouble = 0; paramArrayOfDouble < arrayOfDouble5.length; paramArrayOfDouble++) {
                if (Double.isNaN(arrayOfDouble5[paramArrayOfDouble])) {
                    arrayOfDouble5[paramArrayOfDouble] = 0.0D;
                }
            }
            for (paramArrayOfDouble = 0; paramArrayOfDouble < paramInt1.length; paramArrayOfDouble++) {
                if (Double.isNaN(paramInt1[paramArrayOfDouble])) {
                    paramInt1[paramArrayOfDouble] = 0.0D;
                }
            }
            return new TF_TD_Libraries.FeatureExtrationReturn(this.a, d1, d2, d3, arrayOfDouble1, arrayOfDouble3, arrayOfDouble4, arrayOfDouble5, paramInt1);
        }
    }

    public class TF_TD_PREPROCESSING
    {
        private double[] a;
        private double[] b;
        private double[] c;
        private double[] d;
        private double[] e;
        private double[] f;
        private double[] g;
        private TF_TD_Libraries.Butter_Return h;

        public TF_TD_PREPROCESSING(TF_TD_Libraries paramTF_TD_Libraries) {}

        public double[] TF_TD_preprocessing(double[] paramArrayOfDouble, int paramInt)
        {
            paramInt = new TF_TD_Libraries.Detrend(this.i);
            this.a = paramInt.removeLinearTrend(paramArrayOfDouble);
            paramArrayOfDouble = new TF_TD_Libraries.Butter(this.i);
            this.g = new double[2];
            this.g[0] = 0.001953125D;
            this.g[1] = 0.17578125D;
            this.h = paramArrayOfDouble.ButterworthBandPassFilter(5, this.g);
            this.b = this.h.get_B();
            this.c = this.h.get_A();
            paramArrayOfDouble = new TF_TD_Libraries.filtfilt(this.i);
            this.d = paramArrayOfDouble.ZeroPhaseFiltering(this.b, this.c, this.a);
            paramArrayOfDouble = new TF_TD_Libraries.TF_TD_eyeblink_v2(this.i);
            this.e = paramArrayOfDouble.eyeblinkv2_fun(this.d);
            this.f = new double[this.e.length];
            for (paramArrayOfDouble = 0; paramArrayOfDouble < this.f.length; paramArrayOfDouble++) {
                this.f[paramArrayOfDouble] = (this.e[paramArrayOfDouble] * 2.0D / 4096.0D / 2000.0D);
            }
            return this.f;
        }
    }

}
